!{include file='common/iheader.htm'}
<link rel="stylesheet" type="text/css" href="!{res file='yu_zoom/css/yuZoom.css'}"></link> 
<style>
	.image_list{width:98%;float:none;display: inline-block;border-top:3px solid #AED0EA;padding:5px;}
	.image_list .img_wrap{float:left;margin-right:8px;}
	.image_list li{width:270px;}
	.i_wrap{}
	#show_3d{float:left;height:420px;margin-right:8px;overflow:hidden;width:98%;}
</style>
<div id="i_nav">
	<h3 class="page_title">产品预览 - !{$show_360.name}</h3>
	<a class="button" href="/manager.php?app=show_360">产品管理</a>
	<a class="button" href="/manager.php?app=show_360&act=edit&id=!{$smarty.request.id}">编辑产品</a>
	<a class="button" href="/manager.php?app=show_360&act=edit">添加产品</a>
</div>
!{if $info}
<p class="tips ui-state-highlight ui-corner-all">!{$info}</p>
!{else}
<div id="show_3d"></div>
!{/if}
<script charset="utf8" src="!{res file='yu_zoom/js/jquery.mousewheel.min.js'}"></script>
<script charset="utf8" src="!{res file='yu_zoom/js/yuUtils.js'}"></script>
<script charset="utf8" src="!{res file='yu_zoom/js/yuZoom_lan_zh-cn.js'}"></script>
<script charset="utf8" src="!{res file='yu_zoom/js/yuZoom-min.js'}"></script>
<script>
	var yuZoomKey = '!{$site_id}';
	$(function(){
		yuZoom = new YuZoom({
			content: $("#show_3d"),
			configUrl : 'http://yulin.duoec.com/index.php?app=show360&act=config&id=!{$smarty.request.id}'
		});
		cur_id = 12;
	//	yuZoom.autoPlay({callback:shake});
		yuZoom.autoPlay({count:2});
		
	});
	
	function shake(){
		var state = yuZoom.getState();
		$("#yuZoom_" + state.id).mouseover(function(){
			shake_stop = true;
			
		}).mouseout(function(){
			shake_stop = false;
			setTimeout(function(){
				//shake_help();
			},0);
		});
		var middle_count = parseInt(state.count / 2);
		yuZoom.turn(middle_count,function(){
			//shake_help();
		});
	}
	
	
	
	var shake_stop = false;
	var cur_shake_revert = true;
	var ii = 0;
	function shake_help(){
		if(shake_stop)return;
		var state = yuZoom.getState();
		var speed = 80;//Math.abs(parseInt(Math.sin(180 * state.clockwiseLevel * 2 / state.count) * 200));
		//document.title = ii + ":" + state.clockwiseLevel + "--" + speed;
		if(state.clockwiseLevel==1){
			cur_shake_revert = false;
		}
		if(state.clockwiseLevel == state.count / 2)
			cur_shake_revert = true;
		yuZoom.turn(cur_shake_revert?-1:1);
		setTimeout(function(){
			++ii;			
			shake_help();
		},speed);
	}
	var yuZoom = null;
	var cur_id = 0;
</script>
!{include file='common/ifooter.htm'}